<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html lang="en">
<head>
	<meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
	<title>函数</title>
</head>
<body>
<!-- 
    <script type="text/javascript">
        function  myFunction(){
        	alert('Hello World');
        }

    </script>

    <button onclick="myFunction()">点击这里弹出 Hello World</button> -->

    <!-- 传多个参数 -->
<!--     <button onclick="myFunction('潘莹','无业游民')">点击这里</button>
    <script type="text/javascript">
        function   myFunction(name,job){
        	alert('Welcome'+name+",the"+job);
        }

    </script>
	 -->

    <!-- 函数返回值 -->


    <script type="text/javascript">
        function myFunction(){
            var num=5;
            return num;
        }
            alert(myFunction());
        
        var myVar = myFunction();
        document.getElementById("demo").innerHTML = myFunction();
        alert(demo.innerHTML);

    </script>

  <p id="demo">My first paragragh</p>


</body>
</html>